package com.gxa.web_admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.R;
import com.gxa.modules.pojo.CarriersContract;
import com.gxa.modules.service.CarriersContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/contract")
public class CarriersContractController {

    @Autowired
    private CarriersContractService carriersContractService;

    /**
     * 查询承运商合同所有信息
     * @return
     */
    @GetMapping("/findCarriersContractList")
    public JsonResult findCarriersContractList(Long currentPage, Long pageSize){
        return carriersContractService.findCarriersContractList(currentPage,pageSize);
    }

    /** 
     * 条件查询承运商合同所有信息
     * @return
     */
    @GetMapping("/findCarriersContractByCondition")
    public JsonResult findCarriersContractByCondition(Long currentPage, Long pageSize, String name, String contract_name, String add_time){
        return carriersContractService.findCarriersContractByCondition(currentPage,pageSize,name,contract_name,add_time);
    }

    /**
     * 根据id查询承运商合同信息
     * @return
     */
    @GetMapping("/queryCarriersContractById")
    public R queryCarriersContractById(Integer id){
        return carriersContractService.queryCarriersContractById(id);
    }

    /**
     * 根据id删除承运商合同信息
     * @return
     */
    @GetMapping("/delCarriersContractById")
    public R delCarriersContractById(Integer id){
        return carriersContractService.delCarriersContractById(id);
    }

    /**
     * 添加承运商合同
     * @return
     */
    @PostMapping("/addCarriersContract")
    public R addCarriersContract(@RequestBody CarriersContract carriersContract){
        return carriersContractService.addCarriersContract(carriersContract);
    }
}
